package com.ruoyi.yyq.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.yyq.api.factory.RemoteUserCouponFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 用户服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteUserCouponService", value = ServiceNameConstants.YYQ_SERVICE, fallbackFactory = RemoteUserCouponFallbackFactory.class)
public interface RemoteUserCouponService
{
    @GetMapping(value = "/usercoupon/{id}")
    public AjaxResult getInfo(@RequestHeader(SecurityConstants.FROM_SOURCE) String source, @PathVariable("id") Long id);

    @GetMapping(value = "/user/{uid}/coupon/{cid}")
    public AjaxResult getInfo(@RequestHeader(SecurityConstants.FROM_SOURCE) String source, @PathVariable("uid") Long uid,@PathVariable("cid") Long cid);
    /*
     * 暴露根据用户id查询用户优惠卷
     */

    @GetMapping(value = "/getquan/{uid}")
    public AjaxResult getquan(@RequestHeader(SecurityConstants.INNER) String source,@PathVariable("uid") Long uid);
}
